package txc.test.service.api.impl;

import com.taobao.txc.common.TxcContext;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;

import txc.test.dto2.TDTO;
import txc.test.model.T;
import txc.test.service.TService;
import txc.test.service.api2.TServiceApi2;


public class TServiceApiImpl2 implements TServiceApi2 {

    @Autowired
    private TService tService;

    @Override
    public int insertSelective(TDTO record) {
        T t = new T();
        BeanUtils.copyProperties(record,t);
        return tService.insertSelective(t);
    }

    @Override
    public int insertSelectiveTxc(TDTO record, String txcId) {
        TxcContext.bind(txcId,null);
        T t = new T();
        BeanUtils.copyProperties(record,t);
        return tService.insertSelective(t);
    }
}
